package com.ruoyi.smartcity.park.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.smartcity.park.mapper.ParkChongzhiMapper;
import com.ruoyi.smartcity.park.domain.ParkChongzhi;
import com.ruoyi.smartcity.park.service.IParkChongzhiService;

/**
 * 充值信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-27
 */
@Service
public class ParkChongzhiServiceImpl implements IParkChongzhiService 
{
    @Autowired
    private ParkChongzhiMapper parkChongzhiMapper;

    /**
     * 查询充值信息
     * 
     * @param id 充值信息主键
     * @return 充值信息
     */
    @Override
    public ParkChongzhi selectParkChongzhiById(Long id)
    {
        return parkChongzhiMapper.selectParkChongzhiById(id);
    }

    /**
     * 查询充值信息列表
     * 
     * @param parkChongzhi 充值信息
     * @return 充值信息
     */
    @Override
    public List<ParkChongzhi> selectParkChongzhiList(ParkChongzhi parkChongzhi)
    {
        return parkChongzhiMapper.selectParkChongzhiList(parkChongzhi);
    }

    /**
     * 新增充值信息
     * 
     * @param parkChongzhi 充值信息
     * @return 结果
     */
    @Override
    public int insertParkChongzhi(ParkChongzhi parkChongzhi)
    {
        parkChongzhi.setCreateTime(DateUtils.getNowDate());
        return parkChongzhiMapper.insertParkChongzhi(parkChongzhi);
    }

    /**
     * 修改充值信息
     * 
     * @param parkChongzhi 充值信息
     * @return 结果
     */
    @Override
    public int updateParkChongzhi(ParkChongzhi parkChongzhi)
    {
        parkChongzhi.setUpdateTime(DateUtils.getNowDate());
        return parkChongzhiMapper.updateParkChongzhi(parkChongzhi);
    }

    /**
     * 批量删除充值信息
     * 
     * @param ids 需要删除的充值信息主键
     * @return 结果
     */
    @Override
    public int deleteParkChongzhiByIds(Long[] ids)
    {
        return parkChongzhiMapper.deleteParkChongzhiByIds(ids);
    }

    /**
     * 删除充值信息信息
     * 
     * @param id 充值信息主键
     * @return 结果
     */
    @Override
    public int deleteParkChongzhiById(Long id)
    {
        return parkChongzhiMapper.deleteParkChongzhiById(id);
    }

    @Override
    public ParkChongzhi selectParkChongzhiByUserid(Long userid) {
        return parkChongzhiMapper.selectParkChongzhiByUserid(userid);
    }
}
